
class EarnWinsController < ApplicationController
  # List free wins bought and current streak level
  def index
    if count = params[:sent_count]
      flash[:notice] = "#{} invitation(s) sent. You earn #{count * 50} WinPoints!"
    end
    @buy_wins = BuyWin.find(:all)
    @level = current_user.current_winstreak_count.round + 1
    @installed_friends=facebook_session.fql_query("SELECT uid FROM user WHERE is_app_user = 1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = #{current_user.id})").join(",")

    respond_to do |format|
      format.fbml # index.fbml.erb
      format.xml  { render :xml => @buy_wins }
    end
  end
end

